function fn() {
    var n = document.querySelector('.inp1').value
    var p = document.querySelector('.inp2').value
    var na = localStorage.getItem('name')
    var pa = localStorage.getItem('password')
    if (n == '' && p == '') {
        alert('用户名或密码不能为空')
    } else if (n != na && p != pa || n == na && p != pa || n != na && p == pa) {
        alert('用户名或密码有误')
    } else if (n == na && p == pa) {
        location.assign('../首页/首页.html')
        alert("登陆成功")
    }
}